package com.wson.model.compass.portfolio.impl;

import java.util.List;
import java.util.Map;

import com.wson.dao.entity.proton.IProtonEntityProp;
import com.wson.model.basic.IMarkableField;
import com.wson.model.compass.portfolio.ICompassPortfolioManip;
import com.wson.model.compass.portfolio.ICompassPortfolioView;
import com.wson.model.framework.portfolio.impl.PortfolioModel;

public class CompassPortfolioModel extends PortfolioModel 
	implements ICompassPortfolioView, ICompassPortfolioManip{
	@IMarkableField(Attribute=ATTR_AUTOMATICDOWNLOAD, Syntax=SYNC_AUTOMATICDOWNLOAD
			, PropID=PROP_COMPASS, PropIndex=IProtonEntityProp.PROP_VALUEINDEX_1
			, Behavior=REPLETENCY_NONE
	)
	private Boolean automiaticDownload;
	
	@IMarkableField(Attribute=ATTR_CODISKACCOUNTID, Syntax=SYNC_CODISKACCOUNTID
			, PropID=PROP_COMPASS, PropIndex=IProtonEntityProp.PROP_VALUEINDEX_2
			, Behavior=REPLETENCY_NONE
	)
	private Long codiskAccountID=1000L;

	public Boolean getAutomiaticDownload() {
		return automiaticDownload;
	}

	public void setAutomiaticDownload(Boolean automiaticDownload) {
		this.automiaticDownload = automiaticDownload;
	}

	public Long getCodiskAccountID() {
		return codiskAccountID;
	}

	public void setCodiskAccountID(Long codiskAccountID) {
		this.codiskAccountID = codiskAccountID;
	}

	@Override
	public List<Map<String, Object>> generateBehaviorStructures(int type) {
		if(type==BEHAVIORSTRUCTURE_DISPLAYFORM){
			List<Map<String, Object>> structures = super.generateBehaviorStructures(type);
			structures.add(this.generateBehaviorStructure(SYNC_CODISKACCOUNTID, false));
			return structures;
		}
		return super.generateBehaviorStructures(type);
	}

	
}
